// https://nuxt.com/docs/api/configuration/nuxt-config
import Components from 'unplugin-vue-components/vite'
export default defineNuxtConfig({
  devtools: { enabled: false },

  app:{
    head: {
      title: "学习512",
      titleTemplate:"%s-致力于帮助有梦想的年轻人获取学习价值",
      charset: "utf-8",
      htmlAttrs: {
        lang: "zh-cn",
      },
      link: [
        { rel: 'stylesheet', href: '/fonts/iconfont.css' },
        { rel: 'stylesheet', href: '/css/animate.css' }
      ]
    },
    pageTransition: {
      name: 'fade',
      mode: 'out-in' // 默认值
    }
  },

  modules: [
    '@ant-design-vue/nuxt',
    '@nuxtjs/i18n',
    ['@pinia/nuxt',{
      autoImports:['defineStore']
    }],
    '@pinia-plugin-persistedstate/nuxt',
  ],

  css: [
    "@/assets/css/main.css",
  ],

  build: {
    transpile:
        process.env.NODE_ENV === 'production'
            ? [
              'naive-ui',
              'vueuc',
              '@css-render/vue3-ssr',
              '@juggle/resize-observer'
            ]
            : ['@juggle/resize-observer']
  },

  vite: {
    esbuild : {
      drop: process.env.NODE_ENV === 'production' ? ['console','debugger'] :[]
    },
    build :{
      minify: 'esbuild',
      chunkSizeWarningLimit: 1024,
      cssCodeSplit: true
    },
  },

  antd:{

  },

  i18n: {
    vueI18n: './i18n/i18n.config.js' // if you are using custom path, default
  },

  imports: {
    dirs: ["apis","utils"],
  },

  nitro: {
    // 缩小捆绑包
    minify: true,
    // 关闭源映射生成
    sourceMap: false,
  },

  compatibilityDate: '2024-08-25'
})